<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%
	User user = (User) session.getAttribute("user");
	String pwd = user.getPassword();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="com.foredu.fiqs.domain.User"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>湖北职业技术学院财务信息查询系统</title>
<LINK href="style/css.css" type="text/css" rel="stylesheet">
<script type="text/javascript">
function checkForm() {
	var password = document.getElementById("password").value;
	var passwordn = document.getElementById("passwordn").value;
	var passwordo = document.getElementById("passwordo").value;
	if (passwordo != "<%=pwd%>"){
		alert("旧密码输入有误！");
		return false;
	}
	if (password == "" || password.length<6) {
		alert("请输入六位数以上新密码！");
		return false;
	}
	if (password != passwordn) {
		alert("两次密码输入不相符！ ");
		return false;
	}
}
</script>
</head>
<body>
<html:form action="user.do?method=updatePwd" method="post"
	onsubmit="return checkForm();">
	<table width="80%" border="0" align="center" cellpadding="0"
		cellspacing="1" class="tableline" id="Table3">
		<html:hidden property="id" value="${user.id}" />
		<tr class="m_lef">
			<td height="40" colspan="9" align="center" bgcolor="#ffffff"
				class="STYLE4">修改密码</td>
		</tr>
		<tr class="m_lef">
			<td height="26" align="right" bgcolor="#ffffff" class="c_title_memed"><font
				face="宋体">用户姓名：</font></td>
			<td colspan="8" bgcolor="#ffffff"><font size="3pxpx">&nbsp;${user.nickname
			}</font></td>
		</tr>
		<tr class="m_lef">
			<td width="45%" height="30" align="right" bgcolor="#ffffff">用户名：</td>
			<td colspan="8" bgcolor="#ffffff"><font size="3px">&nbsp;${user.username
			}</font></td>
		</tr>
		<tr class="m_lef">
			<td height="30" align="right" bgcolor="#ffffff">旧密码：</td>
			<td colspan="8" bgcolor="#ffffff">&nbsp;<input type="password"
				id="passwordo" name="password1" /></td>
		</tr>
		<tr class="m_lef">
			<td height="30" align="right" bgcolor="#ffffff">新密码：</td>
			<td colspan="8" bgcolor="#ffffff">&nbsp;<input type="password"
				id="password" name="password" /></td>
		</tr>
		<tr class="m_lef">
			<td height="30" align="right" bgcolor="#ffffff">重复密码：</td>
			<td colspan="8" bgcolor="#ffffff">&nbsp;<input type="password"
				id="passwordn" name="password2" /></td>
		</tr>
		<tr>
			<td height="30" colspan="9" align="center" bgcolor="#ffffff"
				class="c_foot"><html:submit value="修改" /> <html:reset
				value="重置" /></td>
		</tr>
	</table>
</html:form>
</body>
</html>